import { request } from "../request"


export const apiSysOrgListGet = (id: number, name?: string, code?: string, type?: string, tenantId?: number|undefined)=>{
    return request({
        url:'/api/sysOrg/list',
        method:'GET',
        params:{
            id,
            name,
            code,
            type,
            tenantId
        }
    })
}

export const apiSysOrgUpdatePost = (data:any)=>{
    return request({
        url:'/api/sysOrg/update',
        method:'POST',
        data
    })
}

export const apiSysOrgAddPost = (data:any)=>{
    return request({
        url:'/api/sysOrg/add',
        method:'POST',
        data
    }) 
}

export const apiSysOrgDeletePost = (data:any)=>{
    return request({
        url:'/api/sysOrg/delete',
        method:'POST',
        data
    })
}


export const apiSysOrgGetDeptUsers = ()=>{
    return request({
        url:'/api/sysOrg/deptUsers',
        method:'GET'
    })
}

export const apiGetCurLoginUserDirectorInfo = (id:any)=>{
    return request({
        url:`/api/sysOrg/curLoginUserDirectorInfo/${id}`,
        method:'GET'
    })
}

export const apiGetCurOrgParent = (id:any)=>{
    return request({
        url:`/api/sysOrg/curOrgParent/${id}`,
        method:'GET'
    })
}